/**
 * Javascript-Hilfsfunktionen...
 *
 * @author Timo
 */
        function addVehicle()
        {
            if (typeof addVehicle.counter == 'undefined')
            {
                addVehicle.counter = 1;
            }
            addVehicle.counter++;

            var vehicle = 'vehicle' + addVehicle.counter.toString() + '_';
            var html = '<br />';
            html += '<font size="5"><b>Fahrzeug ';
            html += addVehicle.counter.toString();
            html += '</b></font><br />';
            html += 'Name   <input type="text" name="';
            html += vehicle;
            html += 'name" size="25" maxlength="50" /><br />';
            html += '<br /><u>OPTIONAL</u><br/>';
            html += 'Motor   <input type="text" name="';
            html += vehicle;
            html += 'engine" size="25" maxlength="50" /><br />';
            html += 'PS   <input type="text" name="';
            html += vehicle;
            html += 'power" size="4" maxlength="4" /><br />';
            html += 'RPM  <input type="text" name="';
            html += vehicle;
            html += 'rpm" size="5" maxlength="5" /><br />';
            document.getElementById('newVehicle').innerHTML += html;

            document.series_form.vehicle_count.value = addVehicle.counter;

            document.forms['series_form'].elements[vehicle + 'name'].focus();
            this.scrollBy(0, 500);
        }

        function validate()
        {
            if (document.series_form.series_name.value == '')
            {
                alert('Please enter a series name.');
                document.series_form.series_name.focus();
                return false;
            }
            if (document.series_form.vehicle1_name.value == '')
            {
                alert('INFO: No Vehicle will be added.');
            }
            if(document.series_form.vehicle_count.value < 1)
            {
                document.series_form.vehicle_count.value = '1';
            }
            if (document.series_form.max_slots.value == '')
            {
                alert('The maximum amount of drivers will be set to default. (24)');
                document.series_form.max_slots.value = '24';
            }
            if (document.series_form.max_teamslots.value == '')
            {
                alert('The maximum amount of drivers per team will be set to default. (2)');
                document.series_form.max_teamslots.value = '2';
            }
            return true;
        }